#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "system.h" 

 
// integrate the equations of motion
void Integrate() {
  int i;
  VECTOR dr;

  //velocity verlet integrator
  for(i=0;i<NumberOfParticles;i++)  {

    /* now you have to implement the routine for dr. The Forces are
       saved in an VECTOR array called Forces
    */


        PositionsNONPDB[i].x += dr.x;
	PositionsNONPDB[i].y += dr.y;
	PositionsNONPDB[i].z += dr.z;

	Positions[i].x += dr.x;
	Positions[i].y += dr.y;
	Positions[i].z += dr.z;
	//periodic boundary condition
	if(Positions[i].x>=Box)
		Positions[i].x-=Box;
        else if(Positions[i].x<0.0)
	        Positions[i].x+=Box;

        if(Positions[i].y>=Box)
		Positions[i].y-=Box;
	else if(Positions[i].y<0.0)
                Positions[i].y+=Box;

        if(Positions[i].z>=Box)
		Positions[i].z-=Box;
        else if(Positions[i].z<0.0)
                Positions[i].z+=Box;

       OldForces[i].x = Forces[i].x;
       OldForces[i].y = Forces[i].y;
       OldForces[i].z = Forces[i].z;
    }
    
    Force();

    // Here is the right place for the calculation of the velocities

 
}
